"use strict";var ce=Object.defineProperty;var nt=Object.getOwnPropertyDescriptor;var rt=Object.getOwnPropertyNames;var it=Object.prototype.hasOwnProperty;var ot=(e,i)=>{for(var c in i)ce(e,c,{get:i[c],enumerable:!0})},at=(e,i,c,g)=>{if(i&&typeof i=="object"||typeof i=="function")for(let p of rt(i))!it.call(e,p)&&p!==c&&ce(e,p,{get:()=>i[p],enumerable:!(g=nt(i,p))||g.enumerable});return e};var st=e=>at(ce({},"__esModule",{value:!0}),e);var Tt={};ot(Tt,{QueryStatus:()=>ie,buildCreateApi:()=>de,copyWithStructuralSharing:()=>Y,coreModule:()=>pe,coreModuleName:()=>re,createApi:()=>tt,defaultSerializeQueryArgs:()=>ne,fakeBaseQuery:()=>He,fetchBaseQuery:()=>be,retry:()=>Be,setupListeners:()=>Ee,skipToken:()=>te});module.exports=st(Tt);var ie=(p=>(p.uninitialized="uninitialized",p.pending="pending",p.fulfilled="fulfilled",p.rejected="rejected",p))(ie||{});function he(e){return{status:e,isUninitialized:e==="uninitialized",isLoading:e==="pending",isSuccess:e==="fulfilled",isError:e==="rejected"}}function Te(e){return new RegExp("(^|:)//").test(e)}var ut=e=>e.replace(/\/$/,""),yt=e=>e.replace(/^\//,"");function Qe(e,i){if(!e)return i;if(!i)return e;if(Te(i))return i;let c=e.endsWith("/")||!i.startsWith("?")?"/":"";return e=ut(e),i=yt(i),`${e}${c}${i}`}var le=e=>[].concat(...e);function Re(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}function Se(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}var r=require("@reduxjs/toolkit");var Ae=r.isPlainObject;function Y(e,i){if(e===i||!(Ae(e)&&Ae(i)||Array.isArray(e)&&Array.isArray(i)))return i;let c=Object.keys(i),g=Object.keys(e),p=c.length===g.length,S=Array.isArray(i)?[]:{};for(let A of c)S[A]=Y(e[A],i[A]),p&&(p=e[A]===S[A]);return p?e:S}var De=(...e)=>fetch(...e),dt=e=>e.status>=200&&e.status<=299,pt=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function xe(e){if(!(0,r.isPlainObject)(e))return e;let i={...e};for(let[c,g]of Object.entries(i))g===void 0&&delete i[c];return i}function be({baseUrl:e,prepareHeaders:i=l=>l,fetchFn:c=De,paramsSerializer:g,isJsonContentType:p=pt,jsonContentType:S="application/json",jsonReplacer:A,timeout:b,responseHandler:k,validateStatus:T,...y}={}){return typeof fetch>"u"&&c===De&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),async(o,t)=>{let{signal:m,getState:D,extra:h,endpoint:d,forced:a,type:u}=t,n,{url:s,headers:Q=new Headers(y.headers),params:f=void 0,responseHandler:R=k??"json",validateStatus:x=T??dt,timeout:M=b,...B}=typeof o=="string"?{url:o}:o,E={...y,signal:m,...B};Q=new Headers(xe(Q)),E.headers=await i(Q,{getState:D,extra:h,endpoint:d,forced:a,type:u})||Q;let P=v=>typeof v=="object"&&((0,r.isPlainObject)(v)||Array.isArray(v)||typeof v.toJSON=="function");if(!E.headers.has("content-type")&&P(E.body)&&E.headers.set("content-type",S),P(E.body)&&p(E.headers)&&(E.body=JSON.stringify(E.body,A)),f){let v=~s.indexOf("?")?"&":"?",z=g?g(f):new URLSearchParams(xe(f));s+=v+z}s=Qe(e,s);let C=new Request(s,E);n={request:new Request(s,E)};let w,F=!1,O=M&&setTimeout(()=>{F=!0,t.abort()},M);try{w=await c(C)}catch(v){return{error:{status:F?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(v)},meta:n}}finally{O&&clearTimeout(O)}let q=w.clone();n.response=q;let L,U="";try{let v;if(await Promise.all([l(w,R).then(z=>L=z,z=>v=z),q.text().then(z=>U=z,()=>{})]),v)throw v}catch(v){return{error:{status:"PARSING_ERROR",originalStatus:w.status,data:U,error:String(v)},meta:n}}return x(w,L)?{data:L,meta:n}:{error:{status:w.status,data:L},meta:n}};async function l(o,t){if(typeof t=="function")return t(o);if(t==="content-type"&&(t=p(o.headers)?"json":"text"),t==="json"){let m=await o.text();return m.length?JSON.parse(m):null}return o.text()}}var N=class{constructor(i,c=void 0){this.value=i;this.meta=c}};async function ct(e=0,i=5){let c=Math.min(e,i),g=~~((Math.random()+.4)*(300<<c));await new Promise(p=>setTimeout(S=>p(S),g))}function lt(e){throw Object.assign(new N({error:e}),{throwImmediately:!0})}var Me={},ft=(e,i)=>async(c,g,p)=>{let S=[5,(i||Me).maxRetries,(p||Me).maxRetries].filter(y=>y!==void 0),[A]=S.slice(-1),k={maxRetries:A,backoff:ct,retryCondition:(y,l,{attempt:o})=>o<=A,...i,...p},T=0;for(;;)try{let y=await e(c,g,p);if(y.error)throw new N(y);return y}catch(y){if(T++,y.throwImmediately){if(y instanceof N)return y.value;throw y}if(y instanceof N&&!k.retryCondition(y.value.error,c,{attempt:T,baseQueryApi:g,extraOptions:p}))return y.value;await k.backoff(T,k.maxRetries)}},Be=Object.assign(ft,{fail:lt});var H=(0,r.createAction)("__rtkq/focused"),V=(0,r.createAction)("__rtkq/unfocused"),_=(0,r.createAction)("__rtkq/online"),$=(0,r.createAction)("__rtkq/offline"),fe=!1;function Ee(e,i){function c(){let g=()=>e(H()),p=()=>e(V()),S=()=>e(_()),A=()=>e($()),b=()=>{window.document.visibilityState==="visible"?g():p()};return fe||typeof window<"u"&&window.addEventListener&&(window.addEventListener("visibilitychange",b,!1),window.addEventListener("focus",g,!1),window.addEventListener("online",S,!1),window.addEventListener("offline",A,!1),fe=!0),()=>{window.removeEventListener("focus",g),window.removeEventListener("visibilitychange",b),window.removeEventListener("online",S),window.removeEventListener("offline",A),fe=!1}}return i?i(e,{onFocus:H,onFocusLost:V,onOffline:$,onOnline:_}):c()}function ae(e){return e.type==="query"}function ke(e){return e.type==="mutation"}function G(e,i,c,g,p,S){return mt(e)?e(i,c,g,p).map(oe).map(S):Array.isArray(e)?e.map(oe).map(S):[]}function mt(e){return typeof e=="function"}function oe(e){return typeof e=="string"?{type:e}:e}var Ut=require("@reduxjs/toolkit");function me(e){return e!=null}function K(e){let i=0;for(let c in e)i++;return i}var J=Symbol("forceQueryFn"),X=e=>typeof e[J]=="function";function ve({serializeQueryArgs:e,queryThunk:i,mutationThunk:c,api:g,context:p}){let S=new Map,A=new Map,{unsubscribeQueryResult:b,removeMutationResult:k,updateSubscriptionOptions:T}=g.internalActions;return{buildInitiateQuery:D,buildInitiateMutation:h,getRunningQueryThunk:y,getRunningMutationThunk:l,getRunningQueriesThunk:o,getRunningMutationsThunk:t};function y(d,a){return u=>{let n=p.endpointDefinitions[d],s=e({queryArgs:a,endpointDefinition:n,endpointName:d});return S.get(u)?.[s]}}function l(d,a){return u=>A.get(u)?.[a]}function o(){return d=>Object.values(S.get(d)||{}).filter(me)}function t(){return d=>Object.values(A.get(d)||{}).filter(me)}function m(d){}function D(d,a){let u=(n,{subscribe:s=!0,forceRefetch:Q,subscriptionOptions:f,[J]:R}={})=>(x,M)=>{let B=e({queryArgs:n,endpointDefinition:a,endpointName:d}),E=i({type:"query",subscribe:s,forceRefetch:Q,subscriptionOptions:f,endpointName:d,originalArgs:n,queryCacheKey:B,[J]:R}),P=g.endpoints[d].select(n),C=x(E),I=P(M());let{requestId:w,abort:F}=C,O=I.requestId!==w,q=S.get(x)?.[B],L=()=>P(M()),U=Object.assign(R?C.then(L):O&&!q?Promise.resolve(I):Promise.all([q,C]).then(L),{arg:n,requestId:w,subscriptionOptions:f,queryCacheKey:B,abort:F,async unwrap(){let v=await U;if(v.isError)throw v.error;return v.data},refetch:()=>x(u(n,{subscribe:!1,forceRefetch:!0})),unsubscribe(){s&&x(b({queryCacheKey:B,requestId:w}))},updateSubscriptionOptions(v){U.subscriptionOptions=v,x(T({endpointName:d,requestId:w,queryCacheKey:B,options:v}))}});if(!q&&!O&&!R){let v=S.get(x)||{};v[B]=U,S.set(x,v),U.then(()=>{delete v[B],K(v)||S.delete(x)})}return U};return u}function h(d){return(a,{track:u=!0,fixedCacheKey:n}={})=>(s,Q)=>{let f=c({type:"mutation",endpointName:d,originalArgs:a,track:u,fixedCacheKey:n}),R=s(f);let{requestId:x,abort:M,unwrap:B}=R,E=R.unwrap().then(w=>({data:w})).catch(w=>({error:w})),P=()=>{s(k({requestId:x,fixedCacheKey:n}))},C=Object.assign(E,{arg:R.arg,requestId:x,abort:M,unwrap:B,reset:P}),I=A.get(s)||{};return A.set(s,I),I[x]=C,C.then(()=>{delete I[x],K(I)||A.delete(s)}),n&&(I[n]=C,C.then(()=>{I[n]===C&&(delete I[n],K(I)||A.delete(s))})),C}}}var se=require("immer");function Pe(e){return e}function Ce({reducerPath:e,baseQuery:i,context:{endpointDefinitions:c},serializeQueryArgs:g,api:p,assertTagType:S}){let A=(a,u,n,s)=>(Q,f)=>{let R=c[a],x=g({queryArgs:u,endpointDefinition:R,endpointName:a});if(Q(p.internalActions.queryResultPatched({queryCacheKey:x,patches:n})),!s)return;let M=p.endpoints[a].select(u)(f()),B=G(R.providesTags,M.data,void 0,u,{},S);Q(p.internalActions.updateProvidedBy({queryCacheKey:x,providedTags:B}))},b=(a,u,n,s=!0)=>(Q,f)=>{let x=p.endpoints[a].select(u)(f()),M={patches:[],inversePatches:[],undo:()=>Q(p.util.patchQueryData(a,u,M.inversePatches,s))};if(x.status==="uninitialized")return M;let B;if("data"in x)if((0,se.isDraftable)(x.data)){let[E,P,C]=(0,se.produceWithPatches)(x.data,n);M.patches.push(...P),M.inversePatches.push(...C),B=E}else B=n(x.data),M.patches.push({op:"replace",path:[],value:B}),M.inversePatches.push({op:"replace",path:[],value:x.data});return Q(p.util.patchQueryData(a,u,M.patches,s)),M},k=(a,u,n)=>s=>s(p.endpoints[a].initiate(u,{subscribe:!1,forceRefetch:!0,[J]:()=>({data:n})})),T=async(a,{signal:u,abort:n,rejectWithValue:s,fulfillWithValue:Q,dispatch:f,getState:R,extra:x})=>{let M=c[a.endpointName];try{let B=Pe,E,P={signal:u,abort:n,dispatch:f,getState:R,extra:x,endpoint:a.endpointName,type:a.type,forced:a.type==="query"?y(a,R()):void 0},C=a.type==="query"?a[J]:void 0;if(C?E=C():M.query?(E=await i(M.query(a.originalArgs),P,M.extraOptions),M.transformResponse&&(B=M.transformResponse)):E=await M.queryFn(a.originalArgs,P,M.extraOptions,I=>i(I,P,M.extraOptions)),typeof process<"u",E.error)throw new N(E.error,E.meta);return Q(await B(E.data,E.meta,a.originalArgs),{fulfilledTimeStamp:Date.now(),baseQueryMeta:E.meta,[r.SHOULD_AUTOBATCH]:!0})}catch(B){let E=B;if(E instanceof N){let P=Pe;M.query&&M.transformErrorResponse&&(P=M.transformErrorResponse);try{return s(await P(E.value,E.meta,a.originalArgs),{baseQueryMeta:E.meta,[r.SHOULD_AUTOBATCH]:!0})}catch(C){E=C}}throw typeof process<"u",console.error(E),E}};function y(a,u){let n=u[e]?.queries?.[a.queryCacheKey],s=u[e]?.config.refetchOnMountOrArgChange,Q=n?.fulfilledTimeStamp,f=a.forceRefetch??(a.subscribe&&s);return f?f===!0||(Number(new Date)-Number(Q))/1e3>=f:!1}let l=(0,r.createAsyncThunk)(`${e}/executeQuery`,T,{getPendingMeta(){return{startedTimeStamp:Date.now(),[r.SHOULD_AUTOBATCH]:!0}},condition(a,{getState:u}){let n=u(),s=n[e]?.queries?.[a.queryCacheKey],Q=s?.fulfilledTimeStamp,f=a.originalArgs,R=s?.originalArgs,x=c[a.endpointName];return X(a)?!0:s?.status==="pending"?!1:y(a,n)||ae(x)&&x?.forceRefetch?.({currentArg:f,previousArg:R,endpointState:s,state:n})?!0:!Q},dispatchConditionRejection:!0}),o=(0,r.createAsyncThunk)(`${e}/executeMutation`,T,{getPendingMeta(){return{startedTimeStamp:Date.now(),[r.SHOULD_AUTOBATCH]:!0}}}),t=a=>"force"in a,m=a=>"ifOlderThan"in a,D=(a,u,n)=>(s,Q)=>{let f=t(n)&&n.force,R=m(n)&&n.ifOlderThan,x=(B=!0)=>p.endpoints[a].initiate(u,{forceRefetch:B}),M=p.endpoints[a].select(u)(Q());if(f)s(x());else if(R){let B=M?.fulfilledTimeStamp;if(!B){s(x());return}(Number(new Date)-Number(new Date(B)))/1e3>=R&&s(x())}else s(x(!1))};function h(a){return u=>u?.meta?.arg?.endpointName===a}function d(a,u){return{matchPending:(0,r.isAllOf)((0,r.isPending)(a),h(u)),matchFulfilled:(0,r.isAllOf)((0,r.isFulfilled)(a),h(u)),matchRejected:(0,r.isAllOf)((0,r.isRejected)(a),h(u))}}return{queryThunk:l,mutationThunk:o,prefetch:D,updateQueryData:b,upsertQueryData:k,patchQueryData:A,buildMatchThunkActions:d}}function ue(e,i,c,g){return G(c[e.meta.arg.endpointName][i],(0,r.isFulfilled)(e)?e.payload:void 0,(0,r.isRejectedWithValue)(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,g)}var Fe=require("immer"),ee=require("immer");function ye(e,i,c){let g=e[i];g&&c(g)}function W(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function we(e,i,c){let g=e[W(i)];g&&c(g)}var Z={};function Ie({reducerPath:e,queryThunk:i,mutationThunk:c,context:{endpointDefinitions:g,apiUid:p,extractRehydrationInfo:S,hasRehydrationInfo:A},assertTagType:b,config:k}){let T=(0,r.createAction)(`${e}/resetApiState`),y=(0,r.createSlice)({name:`${e}/queries`,initialState:Z,reducers:{removeQueryResult:{reducer(u,{payload:{queryCacheKey:n}}){delete u[n]},prepare:(0,r.prepareAutoBatched)()},queryResultPatched:{reducer(u,{payload:{queryCacheKey:n,patches:s}}){ye(u,n,Q=>{Q.data=(0,ee.applyPatches)(Q.data,s.concat())})},prepare:(0,r.prepareAutoBatched)()}},extraReducers(u){u.addCase(i.pending,(n,{meta:s,meta:{arg:Q}})=>{let f=X(Q);n[Q.queryCacheKey]??={status:"uninitialized",endpointName:Q.endpointName},ye(n,Q.queryCacheKey,R=>{R.status="pending",R.requestId=f&&R.requestId?R.requestId:s.requestId,Q.originalArgs!==void 0&&(R.originalArgs=Q.originalArgs),R.startedTimeStamp=s.startedTimeStamp})}).addCase(i.fulfilled,(n,{meta:s,payload:Q})=>{ye(n,s.arg.queryCacheKey,f=>{if(f.requestId!==s.requestId&&!X(s.arg))return;let{merge:R}=g[s.arg.endpointName];if(f.status="fulfilled",R)if(f.data!==void 0){let{fulfilledTimeStamp:x,arg:M,baseQueryMeta:B,requestId:E}=s,P=(0,r.createNextState)(f.data,C=>R(C,Q,{arg:M.originalArgs,baseQueryMeta:B,fulfilledTimeStamp:x,requestId:E}));f.data=P}else f.data=Q;else f.data=g[s.arg.endpointName].structuralSharing??!0?Y((0,Fe.isDraft)(f.data)?(0,ee.original)(f.data):f.data,Q):Q;delete f.error,f.fulfilledTimeStamp=s.fulfilledTimeStamp})}).addCase(i.rejected,(n,{meta:{condition:s,arg:Q,requestId:f},error:R,payload:x})=>{ye(n,Q.queryCacheKey,M=>{if(!s){if(M.requestId!==f)return;M.status="rejected",M.error=x??R}})}).addMatcher(A,(n,s)=>{let{queries:Q}=S(s);for(let[f,R]of Object.entries(Q))(R?.status==="fulfilled"||R?.status==="rejected")&&(n[f]=R)})}}),l=(0,r.createSlice)({name:`${e}/mutations`,initialState:Z,reducers:{removeMutationResult:{reducer(u,{payload:n}){let s=W(n);s in u&&delete u[s]},prepare:(0,r.prepareAutoBatched)()}},extraReducers(u){u.addCase(c.pending,(n,{meta:s,meta:{requestId:Q,arg:f,startedTimeStamp:R}})=>{f.track&&(n[W(s)]={requestId:Q,status:"pending",endpointName:f.endpointName,startedTimeStamp:R})}).addCase(c.fulfilled,(n,{payload:s,meta:Q})=>{Q.arg.track&&we(n,Q,f=>{f.requestId===Q.requestId&&(f.status="fulfilled",f.data=s,f.fulfilledTimeStamp=Q.fulfilledTimeStamp)})}).addCase(c.rejected,(n,{payload:s,error:Q,meta:f})=>{f.arg.track&&we(n,f,R=>{R.requestId===f.requestId&&(R.status="rejected",R.error=s??Q)})}).addMatcher(A,(n,s)=>{let{mutations:Q}=S(s);for(let[f,R]of Object.entries(Q))(R?.status==="fulfilled"||R?.status==="rejected")&&f!==R?.requestId&&(n[f]=R)})}}),o=(0,r.createSlice)({name:`${e}/invalidation`,initialState:Z,reducers:{updateProvidedBy:{reducer(u,n){let{queryCacheKey:s,providedTags:Q}=n.payload;for(let f of Object.values(u))for(let R of Object.values(f)){let x=R.indexOf(s);x!==-1&&R.splice(x,1)}for(let{type:f,id:R}of Q){let x=(u[f]??={})[R||"__internal_without_id"]??=[];x.includes(s)||x.push(s)}},prepare:(0,r.prepareAutoBatched)()}},extraReducers(u){u.addCase(y.actions.removeQueryResult,(n,{payload:{queryCacheKey:s}})=>{for(let Q of Object.values(n))for(let f of Object.values(Q)){let R=f.indexOf(s);R!==-1&&f.splice(R,1)}}).addMatcher(A,(n,s)=>{let{provided:Q}=S(s);for(let[f,R]of Object.entries(Q))for(let[x,M]of Object.entries(R)){let B=(n[f]??={})[x||"__internal_without_id"]??=[];for(let E of M)B.includes(E)||B.push(E)}}).addMatcher((0,r.isAnyOf)((0,r.isFulfilled)(i),(0,r.isRejectedWithValue)(i)),(n,s)=>{let Q=ue(s,"providesTags",g,b),{queryCacheKey:f}=s.meta.arg;o.caseReducers.updateProvidedBy(n,o.actions.updateProvidedBy({queryCacheKey:f,providedTags:Q}))})}}),t=(0,r.createSlice)({name:`${e}/subscriptions`,initialState:Z,reducers:{updateSubscriptionOptions(u,n){},unsubscribeQueryResult(u,n){},internal_getRTKQSubscriptions(){}}}),m=(0,r.createSlice)({name:`${e}/internalSubscriptions`,initialState:Z,reducers:{subscriptionsUpdated:{reducer(u,n){return(0,ee.applyPatches)(u,n.payload)},prepare:(0,r.prepareAutoBatched)()}}}),D=(0,r.createSlice)({name:`${e}/config`,initialState:{online:Re(),focused:Se(),middlewareRegistered:!1,...k},reducers:{middlewareRegistered(u,{payload:n}){u.middlewareRegistered=u.middlewareRegistered==="conflict"||p!==n?"conflict":!0}},extraReducers:u=>{u.addCase(_,n=>{n.online=!0}).addCase($,n=>{n.online=!1}).addCase(H,n=>{n.focused=!0}).addCase(V,n=>{n.focused=!1}).addMatcher(A,n=>({...n}))}}),h=(0,r.combineReducers)({queries:y.reducer,mutations:l.reducer,provided:o.reducer,subscriptions:m.reducer,config:D.reducer}),d=(u,n)=>h(T.match(n)?void 0:u,n),a={...D.actions,...y.actions,...t.actions,...m.actions,...l.actions,...o.actions,resetApiState:T};return{reducer:d,actions:a}}var te=Symbol.for("RTKQ/skipToken"),Ne={status:"uninitialized"},Oe=(0,r.createNextState)(Ne,()=>{}),qe=(0,r.createNextState)(Ne,()=>{});function Ke({serializeQueryArgs:e,reducerPath:i}){let c=y=>Oe,g=y=>qe;return{buildQuerySelector:A,buildMutationSelector:b,selectInvalidatedBy:k,selectCachedArgsForQuery:T};function p(y){return{...y,...he(y.status)}}function S(y){return y[i]}function A(y,l){return o=>{let t=e({queryArgs:o,endpointDefinition:l,endpointName:y});return(0,r.createSelector)(o===te?c:h=>S(h)?.queries?.[t]??Oe,p)}}function b(){return y=>{let l;return typeof y=="object"?l=W(y)??te:l=y,(0,r.createSelector)(l===te?g:m=>S(m)?.mutations?.[l]??qe,p)}}function k(y,l){let o=y[i],t=new Set;for(let m of l.map(oe)){let D=o.provided[m.type];if(!D)continue;let h=(m.id!==void 0?D[m.id]:le(Object.values(D)))??[];for(let d of h)t.add(d)}return le(Array.from(t.values()).map(m=>{let D=o.queries[m];return D?[{queryCacheKey:m,endpointName:D.endpointName,originalArgs:D.originalArgs}]:[]}))}function T(y,l){return Object.values(y[i].queries).filter(o=>o?.endpointName===l&&o.status!=="uninitialized").map(o=>o.originalArgs)}}var je=WeakMap?new WeakMap:void 0,ne=({endpointName:e,queryArgs:i})=>{let c="",g=je?.get(i);if(typeof g=="string")c=g;else{let p=JSON.stringify(i,(S,A)=>(0,r.isPlainObject)(A)?Object.keys(A).sort().reduce((b,k)=>(b[k]=A[k],b),{}):A);(0,r.isPlainObject)(i)&&je?.set(i,p),c=p}return`${e}(${c})`};var ge=require("reselect");function de(...e){return function(c){let g=(0,ge.weakMapMemoize)(T=>c.extractRehydrationInfo?.(T,{reducerPath:c.reducerPath??"api"})),p={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...c,extractRehydrationInfo:g,serializeQueryArgs(T){let y=ne;if("serializeQueryArgs"in T.endpointDefinition){let l=T.endpointDefinition.serializeQueryArgs;y=o=>{let t=l(o);return typeof t=="string"?t:ne({...o,queryArgs:t})}}else c.serializeQueryArgs&&(y=c.serializeQueryArgs);return y(T)},tagTypes:[...c.tagTypes||[]]},S={endpointDefinitions:{},batch(T){T()},apiUid:(0,r.nanoid)(),extractRehydrationInfo:g,hasRehydrationInfo:(0,ge.weakMapMemoize)(T=>g(T)!=null)},A={injectEndpoints:k,enhanceEndpoints({addTagTypes:T,endpoints:y}){if(T)for(let l of T)p.tagTypes.includes(l)||p.tagTypes.push(l);if(y)for(let[l,o]of Object.entries(y))typeof o=="function"?o(S.endpointDefinitions[l]):Object.assign(S.endpointDefinitions[l]||{},o);return A}},b=e.map(T=>T.init(A,p,S));function k(T){let y=T.endpoints({query:l=>({...l,type:"query"}),mutation:l=>({...l,type:"mutation"})});for(let[l,o]of Object.entries(y)){if(!T.overrideExisting&&l in S.endpointDefinitions){typeof process<"u";continue}S.endpointDefinitions[l]=o;for(let t of b)t.injectEndpoint(l,o)}return A}return A.injectEndpoints({endpoints:c.endpoints})}}var Ue=require("@reduxjs/toolkit");function He(){return function(){throw new Error((0,Ue.formatProdErrorMessage)(33))}}function gt(e){for(let i in e)return!1;return!0}var ht=2147483647/1e3-1,_e=({reducerPath:e,api:i,context:c,internalState:g})=>{let{removeQueryResult:p,unsubscribeQueryResult:S}=i.internalActions;function A(y){let l=g.currentSubscriptions[y];return!!l&&!gt(l)}let b={},k=(y,l,o)=>{if(S.match(y)){let t=l.getState()[e],{queryCacheKey:m}=y.payload;T(m,t.queries[m]?.endpointName,l,t.config)}if(i.util.resetApiState.match(y))for(let[t,m]of Object.entries(b))m&&clearTimeout(m),delete b[t];if(c.hasRehydrationInfo(y)){let t=l.getState()[e],{queries:m}=c.extractRehydrationInfo(y);for(let[D,h]of Object.entries(m))T(D,h?.endpointName,l,t.config)}};function T(y,l,o,t){let D=c.endpointDefinitions[l]?.keepUnusedDataFor??t.keepUnusedDataFor;if(D===1/0)return;let h=Math.max(0,Math.min(D,ht));if(!A(y)){let d=b[y];d&&clearTimeout(d),b[y]=setTimeout(()=>{A(y)||o.dispatch(p({queryCacheKey:y})),delete b[y]},h*1e3)}}return k};var Le=({reducerPath:e,context:i,context:{endpointDefinitions:c},mutationThunk:g,queryThunk:p,api:S,assertTagType:A,refetchQuery:b,internalState:k})=>{let{removeQueryResult:T}=S.internalActions,y=(0,r.isAnyOf)((0,r.isFulfilled)(g),(0,r.isRejectedWithValue)(g)),l=(0,r.isAnyOf)((0,r.isFulfilled)(g,p),(0,r.isRejected)(g,p)),o=[],t=(h,d)=>{y(h)?D(ue(h,"invalidatesTags",c,A),d):l(h)?D([],d):S.util.invalidateTags.match(h)&&D(G(h.payload,void 0,void 0,void 0,void 0,A),d)};function m(h){for(let d in h.queries)if(h.queries[d]?.status==="pending")return!0;for(let d in h.mutations)if(h.mutations[d]?.status==="pending")return!0;return!1}function D(h,d){let a=d.getState(),u=a[e];if(o.push(...h),u.config.invalidationBehavior==="delayed"&&m(u))return;let n=o;if(o=[],n.length===0)return;let s=S.util.selectInvalidatedBy(a,n);i.batch(()=>{let Q=Array.from(s.values());for(let{queryCacheKey:f}of Q){let R=u.queries[f],x=k.currentSubscriptions[f]??{};R&&(K(x)===0?d.dispatch(T({queryCacheKey:f})):R.status!=="uninitialized"&&d.dispatch(b(R,f)))}})}return t};var ze=({reducerPath:e,queryThunk:i,api:c,refetchQuery:g,internalState:p})=>{let S={},A=(o,t)=>{(c.internalActions.updateSubscriptionOptions.match(o)||c.internalActions.unsubscribeQueryResult.match(o))&&k(o.payload,t),(i.pending.match(o)||i.rejected.match(o)&&o.meta.condition)&&k(o.meta.arg,t),(i.fulfilled.match(o)||i.rejected.match(o)&&!o.meta.condition)&&b(o.meta.arg,t),c.util.resetApiState.match(o)&&y()};function b({queryCacheKey:o},t){let D=t.getState()[e].queries[o],h=p.currentSubscriptions[o];if(!D||D.status==="uninitialized")return;let d=l(h);if(!Number.isFinite(d))return;let a=S[o];a?.timeout&&(clearTimeout(a.timeout),a.timeout=void 0);let u=Date.now()+d,n=S[o]={nextPollTimestamp:u,pollingInterval:d,timeout:setTimeout(()=>{n.timeout=void 0,t.dispatch(g(D,o))},d)}}function k({queryCacheKey:o},t){let D=t.getState()[e].queries[o],h=p.currentSubscriptions[o];if(!D||D.status==="uninitialized")return;let d=l(h);if(!Number.isFinite(d)){T(o);return}let a=S[o],u=Date.now()+d;(!a||u<a.nextPollTimestamp)&&b({queryCacheKey:o},t)}function T(o){let t=S[o];t?.timeout&&clearTimeout(t.timeout),delete S[o]}function y(){for(let o of Object.keys(S))T(o)}function l(o={}){let t=Number.POSITIVE_INFINITY;for(let m in o)o[m].pollingInterval&&(t=Math.min(o[m].pollingInterval,t));return t}return A};var We=({reducerPath:e,context:i,api:c,refetchQuery:g,internalState:p})=>{let{removeQueryResult:S}=c.internalActions,A=(k,T)=>{H.match(k)&&b(T,"refetchOnFocus"),_.match(k)&&b(T,"refetchOnReconnect")};function b(k,T){let y=k.getState()[e],l=y.queries,o=p.currentSubscriptions;i.batch(()=>{for(let t of Object.keys(o)){let m=l[t],D=o[t];if(!D||!m)continue;(Object.values(D).some(d=>d[T]===!0)||Object.values(D).every(d=>d[T]===void 0)&&y.config[T])&&(K(D)===0?k.dispatch(S({queryCacheKey:t})):m.status!=="uninitialized"&&k.dispatch(g(m,t)))}})}return A};var Ve=new Error("Promise never resolved before cacheEntryRemoved."),$e=({api:e,reducerPath:i,context:c,queryThunk:g,mutationThunk:p,internalState:S})=>{let A=(0,r.isAsyncThunkAction)(g),b=(0,r.isAsyncThunkAction)(p),k=(0,r.isFulfilled)(g,p),T={},y=(t,m,D)=>{let h=l(t);if(g.pending.match(t)){let d=D[i].queries[h],a=m.getState()[i].queries[h];!d&&a&&o(t.meta.arg.endpointName,t.meta.arg.originalArgs,h,m,t.meta.requestId)}else if(p.pending.match(t))m.getState()[i].mutations[h]&&o(t.meta.arg.endpointName,t.meta.arg.originalArgs,h,m,t.meta.requestId);else if(k(t)){let d=T[h];d?.valueResolved&&(d.valueResolved({data:t.payload,meta:t.meta.baseQueryMeta}),delete d.valueResolved)}else if(e.internalActions.removeQueryResult.match(t)||e.internalActions.removeMutationResult.match(t)){let d=T[h];d&&(delete T[h],d.cacheEntryRemoved())}else if(e.util.resetApiState.match(t))for(let[d,a]of Object.entries(T))delete T[d],a.cacheEntryRemoved()};function l(t){return A(t)?t.meta.arg.queryCacheKey:b(t)?t.meta.requestId:e.internalActions.removeQueryResult.match(t)?t.payload.queryCacheKey:e.internalActions.removeMutationResult.match(t)?W(t.payload):""}function o(t,m,D,h,d){let a=c.endpointDefinitions[t],u=a?.onCacheEntryAdded;if(!u)return;let n={},s=new Promise(B=>{n.cacheEntryRemoved=B}),Q=Promise.race([new Promise(B=>{n.valueResolved=B}),s.then(()=>{throw Ve})]);Q.catch(()=>{}),T[D]=n;let f=e.endpoints[t].select(a.type==="query"?m:D),R=h.dispatch((B,E,P)=>P),x={...h,getCacheEntry:()=>f(h.getState()),requestId:d,extra:R,updateCachedData:a.type==="query"?B=>h.dispatch(e.util.updateQueryData(t,m,B)):void 0,cacheDataLoaded:Q,cacheEntryRemoved:s},M=u(m,x);Promise.resolve(M).catch(B=>{if(B!==Ve)throw B})}return y};var Je=({api:e,context:i,queryThunk:c,mutationThunk:g})=>{let p=(0,r.isPending)(c,g),S=(0,r.isRejected)(c,g),A=(0,r.isFulfilled)(c,g),b={};return(T,y)=>{if(p(T)){let{requestId:l,arg:{endpointName:o,originalArgs:t}}=T.meta,m=i.endpointDefinitions[o],D=m?.onQueryStarted;if(D){let h={},d=new Promise((s,Q)=>{h.resolve=s,h.reject=Q});d.catch(()=>{}),b[l]=h;let a=e.endpoints[o].select(m.type==="query"?t:l),u=y.dispatch((s,Q,f)=>f),n={...y,getCacheEntry:()=>a(y.getState()),requestId:l,extra:u,updateCachedData:m.type==="query"?s=>y.dispatch(e.util.updateQueryData(o,t,s)):void 0,queryFulfilled:d};D(t,n)}}else if(A(T)){let{requestId:l,baseQueryMeta:o}=T.meta;b[l]?.resolve({data:T.payload,meta:o}),delete b[l]}else if(S(T)){let{requestId:l,rejectedWithValue:o,baseQueryMeta:t}=T.meta;b[l]?.reject({error:T.payload??T.error,isUnhandledError:!o,meta:t}),delete b[l]}}};var Ye=({api:e,context:{apiUid:i},reducerPath:c})=>(g,p)=>{e.util.resetApiState.match(g)&&p.dispatch(e.internalActions.middlewareRegistered(i)),typeof process<"u"};var Ge=require("immer");var Xe=({api:e,queryThunk:i,internalState:c})=>{let g=`${e.reducerPath}/subscriptions`,p=null,S=null,{updateSubscriptionOptions:A,unsubscribeQueryResult:b}=e.internalActions,k=(t,m)=>{if(A.match(m)){let{queryCacheKey:h,requestId:d,options:a}=m.payload;return t?.[h]?.[d]&&(t[h][d]=a),!0}if(b.match(m)){let{queryCacheKey:h,requestId:d}=m.payload;return t[h]&&delete t[h][d],!0}if(e.internalActions.removeQueryResult.match(m))return delete t[m.payload.queryCacheKey],!0;if(i.pending.match(m)){let{meta:{arg:h,requestId:d}}=m,a=t[h.queryCacheKey]??={};return a[`${d}_running`]={},h.subscribe&&(a[d]=h.subscriptionOptions??a[d]??{}),!0}let D=!1;if(i.fulfilled.match(m)||i.rejected.match(m)){let h=t[m.meta.arg.queryCacheKey]||{},d=`${m.meta.requestId}_running`;D||=!!h[d],delete h[d]}if(i.rejected.match(m)){let{meta:{condition:h,arg:d,requestId:a}}=m;if(h&&d.subscribe){let u=t[d.queryCacheKey]??={};u[a]=d.subscriptionOptions??u[a]??{},D=!0}}return D},T=()=>c.currentSubscriptions,o={getSubscriptions:T,getSubscriptionCount:t=>{let D=T()[t]??{};return K(D)},isRequestSubscribed:(t,m)=>!!T()?.[t]?.[m]};return(t,m)=>{if(p||(p=JSON.parse(JSON.stringify(c.currentSubscriptions))),e.util.resetApiState.match(t))return p=c.currentSubscriptions={},S=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(t))return[!1,o];let D=k(c.currentSubscriptions,t),h=!0;if(D){S||(S=setTimeout(()=>{let u=JSON.parse(JSON.stringify(c.currentSubscriptions)),[,n]=(0,Ge.produceWithPatches)(p,()=>u);m.next(e.internalActions.subscriptionsUpdated(n)),p=u,S=null},500));let d=typeof t.type=="string"&&!!t.type.startsWith(g),a=i.rejected.match(t)&&t.meta.condition&&!!t.meta.arg.subscribe;h=!d&&!a}return[h,!1]}};function Ze(e){let{reducerPath:i,queryThunk:c,api:g,context:p}=e,{apiUid:S}=p,A={invalidateTags:(0,r.createAction)(`${i}/invalidateTags`)},b=l=>l.type.startsWith(`${i}/`),k=[Ye,_e,Le,ze,$e,Je];return{middleware:l=>{let o=!1,m={...e,internalState:{currentSubscriptions:{}},refetchQuery:y,isThisApiSliceAction:b},D=k.map(a=>a(m)),h=Xe(m),d=We(m);return a=>u=>{if(!(0,r.isAction)(u))return a(u);o||(o=!0,l.dispatch(g.internalActions.middlewareRegistered(S)));let n={...l,next:a},s=l.getState(),[Q,f]=h(u,n,s),R;if(Q?R=a(u):R=f,l.getState()[i]&&(d(u,n,s),b(u)||p.hasRehydrationInfo(u)))for(let x of D)x(u,n,s);return R}},actions:A};function y(l,o,t={}){return c({type:"query",endpointName:l.endpointName,originalArgs:l.originalArgs,subscribe:!1,forceRefetch:!0,queryCacheKey:o,...t})}}function j(e,...i){return Object.assign(e,...i)}var et=require("immer"),re=Symbol(),pe=()=>({name:re,init(e,{baseQuery:i,tagTypes:c,reducerPath:g,serializeQueryArgs:p,keepUnusedDataFor:S,refetchOnMountOrArgChange:A,refetchOnFocus:b,refetchOnReconnect:k,invalidationBehavior:T},y){(0,et.enablePatches)();let l=F=>(typeof process<"u",F);Object.assign(e,{reducerPath:g,endpoints:{},internalActions:{onOnline:_,onOffline:$,onFocus:H,onFocusLost:V},util:{}});let{queryThunk:o,mutationThunk:t,patchQueryData:m,updateQueryData:D,upsertQueryData:h,prefetch:d,buildMatchThunkActions:a}=Ce({baseQuery:i,reducerPath:g,context:y,api:e,serializeQueryArgs:p,assertTagType:l}),{reducer:u,actions:n}=Ie({context:y,queryThunk:o,mutationThunk:t,reducerPath:g,assertTagType:l,config:{refetchOnFocus:b,refetchOnReconnect:k,refetchOnMountOrArgChange:A,keepUnusedDataFor:S,reducerPath:g,invalidationBehavior:T}});j(e.util,{patchQueryData:m,updateQueryData:D,upsertQueryData:h,prefetch:d,resetApiState:n.resetApiState}),j(e.internalActions,n);let{middleware:s,actions:Q}=Ze({reducerPath:g,context:y,queryThunk:o,mutationThunk:t,api:e,assertTagType:l});j(e.util,Q),j(e,{reducer:u,middleware:s});let{buildQuerySelector:f,buildMutationSelector:R,selectInvalidatedBy:x,selectCachedArgsForQuery:M}=Ke({serializeQueryArgs:p,reducerPath:g});j(e.util,{selectInvalidatedBy:x,selectCachedArgsForQuery:M});let{buildInitiateQuery:B,buildInitiateMutation:E,getRunningMutationThunk:P,getRunningMutationsThunk:C,getRunningQueriesThunk:I,getRunningQueryThunk:w}=ve({queryThunk:o,mutationThunk:t,api:e,serializeQueryArgs:p,context:y});return j(e.util,{getRunningMutationThunk:P,getRunningMutationsThunk:C,getRunningQueryThunk:w,getRunningQueriesThunk:I}),{name:re,injectEndpoint(F,O){let q=e;q.endpoints[F]??={},ae(O)?j(q.endpoints[F],{name:F,select:f(F,O),initiate:B(F,O)},a(o,F)):ke(O)&&j(q.endpoints[F],{name:F,select:R(),initiate:E(F)},a(t,F))}}}});var tt=de(pe());
//# sourceMappingURL=rtk-query.production.min.cjs.map